package com.stek.base;

import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.Window;

import com.stek.OneTouchApplication;
import com.stek.R;
import com.stek.main.MainActivity;
import com.stek.utils.AppUtils;

public class BaseOverLayActivity extends AdmodActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		((OneTouchApplication) getApplication()).getGATracking()
				.sendScreenView(getClass());
		super.onCreate(savedInstanceState);
		initActionBar();
		
	}

	protected void initActionBar() {
		requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
		getSupportActionBar().setDisplayHomeAsUpEnabled(true);
		getSupportActionBar().setDisplayShowHomeEnabled(true);
		getSupportActionBar().setBackgroundDrawable(
				new ColorDrawable(getResources().getColor(R.color.blue)));

	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		if (item.getItemId() == android.R.id.home) {
			finish();
			AppUtils.launchActivity(BaseOverLayActivity.this,
					MainActivity.class, true);
		}
		return super.onOptionsItemSelected(item);
	}

}
